﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UstavCSharpServer
{
    public class NetworkMessages
    {
        #region Message creation

        static public string GO(float latitude, float longitude, float altitude)
        {
            string message = String.Format("GO${0};{1};{2};*", latitude, longitude, altitude);
            return message + checksum(message);
        }

        static public string WAIT(int miliseconds)
        {
            string message = String.Format("WT${0}", miliseconds);
            return message + checksum(message);
        }

        static public string LIGHTS(int lightsCode)
        {
            // Convert data to binary string
            string message = String.Format("LC${0}", Convert.ToString(lightsCode, 2));
            return message + checksum(message);
        }

        #endregion

        static public string checksum(string message)
        {
            return "*FF";
        }
    }
}
